import "package:flutter/material.dart";
import "../../../_widget/swiper.dart";

// 热门内容 轮播
class HotSwiperWidget extends StatelessWidget {
  const HotSwiperWidget({super.key});
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(right: 3),
      child: AspectRatio(
        aspectRatio: 4 / 3,
        child: ClipRRect(
          borderRadius: BorderRadius.circular(6),
          child: Container(
            alignment: Alignment.center,
            child: LayoutBuilder(
              builder: ((context, constraints) {
                return Swiper(
                  animatedDuration: const Duration(milliseconds: 150),
                  showIndicator: true,
                  height: constraints.maxHeight,
                  loop: true,
                  auto: true,
                  duration: const Duration(milliseconds: 3000),
                  onCurrentIndexChange: (int val) {},
                  indicatorAlignment: Alignment.bottomCenter,
                  indicatorActiveColor:
                      const Color.fromARGB(255, 247, 113, 157),
                  indicatorInactiveColor: Colors.white,
                  indicatorMainAxisAlignment: MainAxisAlignment.center,
                  indicatorRadius: 5.5,
                  children: [
                    Image.asset("./images/1.jpg", fit: BoxFit.cover),
                    Image.asset("./images/2.jpg", fit: BoxFit.cover),
                    Image.asset("./images/3.jpg", fit: BoxFit.cover),
                  ],
                );
              }),
            ),
          ),
        ),
      ),
    );
  }
}
